//
//  LCAppDelegate.m
//  zhongzhenglu
//
//  Created by 马军凯 on 2023/3/16.
//

#import "LCAppDelegate.h"
#import <IQKeyboardManager.h> //键盘

static LCAppDelegate *app = nil;
@implementation LCAppDelegate
//单例
+ (LCAppDelegate *)share {
    if (app == nil) {
        app = [[LCAppDelegate alloc] init];
    }
    return app;
}
//初始化
- (void)configAppDelegate:(NSDictionary *)launchOptions {
    //键盘
    [self initIQKeyboardManager];
    //更新12.1之后，发现app 首页push一个界面，返回的时候，tabBar上的图标和文字出现一个从上往下的神奇动画
    [UITabBar appearance].translucent = NO;
    //设置tableView
    [self setTableView];
}
#pragma mark 键盘
- (void)initIQKeyboardManager {
    IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
    manager.shouldShowToolbarPlaceholder = YES;
    manager.enable = YES;
    manager.shouldResignOnTouchOutside = YES;
    manager.enableAutoToolbar = YES;
    manager.toolbarManageBehaviour = IQAutoToolbarByPosition;
    manager.shouldToolbarUsesTextFieldTintColor = YES;
}
#pragma mark tableView
- (void)setTableView {
    [UITableView appearance].estimatedRowHeight = 0;
    [UITableView appearance].estimatedSectionFooterHeight = 0;
    [UITableView appearance].estimatedSectionHeaderHeight = 0;
    if (IOS15) {
        [UITableView appearance].sectionHeaderTopPadding = 0;
    }
    
    [UITableView appearance].showsVerticalScrollIndicator = NO;
    [UITableView appearance].showsHorizontalScrollIndicator = NO;
    
    [UITableView appearance].contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}

@end
